<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="string" uri="http://jakarta.apache.org/taglibs/string-1.1" %>
<%@ taglib uri="/WEB-INF/tlds/pagination.tld" prefix="pagination" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>Dayve web</title>
    <link href="/common/css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/common/js/common.js"></script>
    <script type='text/javascript' src="/common/dwr/engine.js"></script>
    <script type='text/javascript' src="/common/dwr/util.js"></script>
    <script type="text/javascript">
        // Locale 설정을 바꾼다.
        function jsChangeLocaleKR() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "index";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=kr";
            TheForm.submit();
        }

        function jsChangeLocaleEN() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "index";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=en";
            TheForm.submit();
        }

        function jsChangeLocaleZH() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "index";
            TheForm.action = "./changeLocale.do?language=zh";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=zh";
            TheForm.submit();
        }

        // Community Board List 페이지로 이동한다.
        function jsCommunityBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "communityBoardList";	// page name
            TheForm.action = "./communityBoardList.do";
            TheForm.submit();
        }

        // Photo Board List 페이지로 이동한다.
        function jsPhotoBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "photoBoardList";	// page name
            TheForm.action = "./photoBoardList.do";
            TheForm.submit();
        }

        // Notice Board List 페이지로 이동한다.
        function jsNoticeBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "noticeBoardList";	// page name
            TheForm.action = "./noticeBoardList.do";
            TheForm.submit();
        }

        // 회원탈퇴
        function jsDeleteMember() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "index";	// page name
            TheForm.action = "./deleteMemberById.do";
            TheForm.submit();
        }

        // Contact Us 페이지로 이동한다.
        function jsContactUs() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "contactus";	// page name
            TheForm.action = "./contactus.do";
            TheForm.submit();
        }

        // FAQ 페이지로 이동한다.
        function jsFAQ() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "faq";	// page name
            TheForm.action = "./faq.do";
            TheForm.submit();
        }

        // 회원정보 수정
        function jsUpdateMember() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "updateMember";	// page name
            TheForm.action = "./updateMember.do";
            TheForm.submit();
        }

        // 회원정보 수정
        function jsLogout() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "index";	// page name
            TheForm.action = "./logout.do";
            TheForm.submit();
        }

        // 메일 보내기
        function jsSendContact() {
            var TheForm = document.frm;
            if(trim(TheForm.content.value) == ""){
//                alert('내용을 입력하세요.');
                alert('<spring:message code="contactUs.jsSendContact.chk" />');
                TheForm.content.value = "";
                TheForm.content.focus();
                return false;
            }else{
//                var now = new Date();                                                  // 현재시간
//                var nowTime = now.getFullYear() + "년" + (now.getMonth()+1) + "월" + now.getDate() + "일" + now.getHours() + "시" + now.getMinutes() + "분" + now.getSeconds() + "초";
//                TheForm.date.value = nowTime;

                for(i = 0; i<TheForm.flag.length; i++){
                    if(TheForm.flag[i].checked == true){
                        TheForm.category.value = TheForm.flag[i].value;
                    }
                }
//                alert('소중한 문의 감사드립니다.');
                alert('<spring:message code="contactUs.jsSendContact.thx" />');
                TheForm.nextTarget.value = "intro";	// page name
                TheForm.action = "./sendContact.do";
                TheForm.submit();
            }
        }

        function jsLogin(){
//            alert('로그인이 필요합니다.');
            alert('<spring:message code="contactUs.jsLogin.ment1" /> ');
//            if(confirm('로그인 페이지로 이동하시겠습니까?')){
            if(confirm('<spring:message code="contactUs.jsLogin.ment2" /> ')){
                location.href = "index.do";
            }else{
                return false;
            }
        }

        // writeFrm 의 첨부파일 버튼 초기화
        function jsFileReset() {
            var obj = eval("frm.fileUp");
            var obj2 = obj.cloneNode(false);
            obj.parentNode.replaceChild(obj2, obj);
            // obj 에 원래 file 필드를 가져와서 clone 노드 obj2 와 바꿔치기
        }


    </script>
</head>
<body>
<div id="wrapper">
    <!------------------------------ top 시작-------------------------------------->
    <%@include file="header.jsp" %>
    <!------------------------------ top 끝-------------------------------------->
    <form name="frm" method="POST" enctype="multipart/form-data">
        <input type="hidden" name="writer_id" value="">
        <input type="hidden" name="writer_nick_name" value="">
        <input type="hidden" name="nextTarget" value="">
        <input type="hidden" name="add_file_yn" value="">
        <input type="hidden" name="date" value="">
        <input type="hidden" name="category" value="">

        <div class="sub_content">
            <img src="/images/intro/sub_title05.gif" />
            <p class="contactus">
                <%--이용하시면서 불편하신 점이나 문의점을 저희에게 보내주세요.<br /> 사소한 문의 사항이라도 보내주시면 더욱 나은 데이브 서비스에 참고하겠습니다.--%>
                <spring:message code="contactUs.feedback" />
            </p>
            <table class="notice_tb">
                <tr>
                    <td class="content_head">
                        <%--<input type="radio" name="flag" value="bug" checked/>버그 신고  --%>
                        <input type="radio" name="flag" value="bug" checked/><spring:message code="contactUs.reportBugs" />  
                        <%--<input type="radio" name="flag" value="nml" />일반 문의--%>
                        <input type="radio" name="flag" value="nml" /><spring:message code="contactUs.normalFaq" />  
                        <%--<input type="radio" name="flag" value="req" />건의 사항--%>
                        <input type="radio" name="flag" value="req" /><spring:message code="contactUs.request" />  
                        <%--<input type="radio" name="flag" value="etc" />기타 </td>--%>
                        <input type="radio" name="flag" value="etc" /><spring:message code="contactUs.etc" /> </td>
                </tr>
                <tr>
                    <td class="write_tb"><textarea name="content" cols="45" rows="20" class="write_textarea"></textarea></td>
                </tr>
                <tr>
                    <td class="write_tb02"><input name="fileUp" type="file" size="50" class="write_attach02" />
                        <a href="javascript:jsFileReset()"><img src="/images/intro/btn_del03.gif" class="write_btn" /></a></td>
                </tr>
            </table>
            <!---------------------------------------- 버튼 -------------------------------------->
            <div class="btn_right02">
                <!-- HttpSession 이 존재하지 않을 경우 글쓰기 버튼 팝업 안됨-->
                <% if(null == s.getAttribute("userId")){  %>
                <a href="javascript:jsLogin()"><img src="/images/intro/btn_send.gif" /></a>
                <%
                }else{
                %>

                <!-- HttpSession 이 존재할 경우 글쓰기 버튼 팝업 -->
                <a href="javascript:jsSendContact()"><img src="/images/intro/btn_send.gif" /></a>
                <% } %>

            </div>
        </div>
        <!------------------------------ 하위메뉴 시작-------------------------------------->
        <%@include file="footer.jsp" %>
        <!------------------------------ 하위메뉴 끝-------------------------------------->
    </form>
</div>
</body>
</html>